import React, { useState } from "react";
import { Button } from "@/components/ui/button";
const Counter1: React.FC = () => {
  const [count, setCount] = useState(0);
  return (
    <div className="p-4 bg-gray-100 rounded-lg shadow-md">
      <h2 className="text-2xl font-bold mb-4">计数器</h2>
      <p className="text-xl mb-4">当前计数: {count}</p>
      <div className="space-x-2">
        <Button onClick={() => setCount(count + 1)}>增加</Button>
        <Button variant="outline" onClick={() => setCount(count - 1)}>
          减少
        </Button>
      </div>
    </div>
  );
};
export default Counter1;
